<template>
	<view class="p30">
		<view class="flex-column-center mt60 mb90">
			<!-- <u-icon :color="isGood == 'true' ? '#06B7F3': '#EC1010'" size="100" name="checkmark-circle-fill"></u-icon> -->
			<text :class="['f30','mt20',isGood == 'true' ? 'c-primary': 'c-danger']">车辆状态{{isGood=='true' ? '正常':'异常'}}</text>
		</view>
		<view class="card-cell-box mt30">
			<u-cell :icon="item.icon" :isLink="item.catchList.length ? true : false" @click="catchDetailFun(item)"
				v-for="item in checkList" :key="item.key" :title="item.label" rightIcon="arrow-right"
				:iconStyle="iconStyle"><template v-slot:value>
					<dot-status label="异常" dotColor="#EC1010" v-if="item.catchList.length"></dot-status>
					<dot-status v-else label="正常"></dot-status>

				</template></u-cell>
		</view>
	</view>
</template>


<script>
	import dotStatus from "@/components/simple/dot-status";
	import {
		mapState
	} from 'vuex';
	import {
		throttle
	} from '@/utils/utils.js'

	export default {
		data() {
			return {
				iconStyle: {
					color: '#06B7F3',
					'font-size': '15px'
				},
				isGood: true,
			}
		},
		components: {
			dotStatus
		},

		computed: {
			...mapState(["checkList"])
		},
		onLoad(params) {
			this.isGood = params.isGood;
		},
		methods: {
			catchDetailFun:throttle(function(key){
				if (this.checkList[key].catchList.length) {
					this.$store.commit("setCatchCodeList",this.checkList[key].catchList);
					this.$navigateTo('/pagesDetail/views/catchDetail');
				}
			})
		}
	}
</script>

<style>
</style>
